<template>
    <div>
          <el-form :model="basicInfo" status-icon ref="ruleForm" label-width="130px" class="demo-ruleForm">
            <el-form-item label="后台网站名称" prop="name">
                <el-input type="text" placeholder="请输入网站名称" v-model="basicInfo.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item class="mini" label="赏袋运费少于">
               <el-input type="number" v-model="basicInfo.goods_less_count" autocomplete="off"></el-input> 
            件，或者回收价值少于 <el-input type="number" v-model="basicInfo.goods_recycle_less_money"></el-input> 元，需要支付运费 
            <el-input type="number" v-model="basicInfo.goods_freight_money"></el-input> 元
            </el-form-item>
            <el-form-item label="余额充值页面" prop="pass">
                 <el-radio v-model="basicInfo.recharge_page_switch" :label="true">开</el-radio>
                 <el-radio v-model="basicInfo.recharge_page_switch" :label="false">关</el-radio>
            </el-form-item>
            <el-form-item label="隐藏盒子消费" prop="pass">
                <el-input type="number" v-model="basicInfo.hidden_box_consume"></el-input>
            </el-form-item>
            <el-form-item class="reditem" label="统计排除UID" prop="pass">
            </el-form-item>
            <el-form-item label="UID" prop="pass">
                <el-input type="text" v-model="basicInfo.statistical_exclude_user_id" autocomplete="off"></el-input> 
            </el-form-item>
            <el-form-item label="物流配置" prop="pass">
            </el-form-item>
            <el-form-item label="物流code" prop="pass">
                <el-input type="text" v-model="basicInfo.freight_code" autocomplete="off"></el-input> 
            </el-form-item>
            <el-form-item label="分享标题" prop="pass">
                <el-input type="text" v-model="basicInfo.a" autocomplete="off"></el-input> 
            </el-form-item>
            <el-form-item>
                <el-button size="small" type="primary" @click="submit">确认保存</el-button>
            </el-form-item>
        </el-form> 
    </div>
</template>

<script>
import web from '../../../api/jurisdiction'
    export default {
        data() {
            return {
                basicInfo: {
                    recharge_page_switch:true
                }
            }
    },
    created() {
        this.getWeb()
    },
        methods: {
            getWeb() {
                web.huoquwangzhan().then((res) => {
                    this.basicInfo = res.data.data
                    console.log('网站设置', this.basicInfo)
                })
            },
            submit() {
                console.log('发送信息',this.basicInfo)
                web.putwangzhan({
                freight_code: this.basicInfo.freight_code,
                goods_freight_money: this.basicInfo.goods_freight_money,
                goods_less_count: this.basicInfo.goods_less_count,
                goods_recycle_less_money: this.basicInfo.goods_recycle_less_money,
                hidden_box_consume: this.basicInfo.hidden_box_consume,
                name: this.basicInfo.goods_freight_money,
                recharge_page_switch:  Boolean(this.basicInfo.recharge_page_switch),
                statistical_exclude_user_id:  this.basicInfo.statistical_exclude_user_id,
                }).then((res) => {
                    this.$message.success("修改成功!")
                })
            }
        },
    }
</script>

<style lang="less" scoped>
.el-input{
    width:250px;
}
.mini .el-input{
    width:100px;
}
</style>